#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include<QLabel>
#include<QMessageBox>
#include"map.h"
#include"mapwidget.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:

    Ui::MainWindow *ui;
    bool ifsignin;//判断是否为登录状态
    MainWindow(QString address=nullptr,QWidget *parent = nullptr,bool i=false);
    ~MainWindow();

private slots:
    void on_searchButton_clicked();

    void on_returnButton_clicked();

    void on_abnearestButton_clicked();

    void on_homeButton_clicked();

    void on_changeButton_clicked();

    void on_nearButton_clicked();

    void on_accountButton_clicked();

    void handleLoginSuccess(QString phone, QString address);

    void on_resigninButton_clicked();

    void on_changeAddressButton_clicked();

    void on_addpath_clicked();

    void on_viaComboBox_activated(int index);

    void on_startComboBox_activated(int index);

private:

    MapWidget *mapWidget;  // 添加成员变量
    QString currentAddress;
    Map map;
    QString viaPoint;
    bool showingTrafficPath = true; // true表示当前显示的是“考虑路况”的路径
};
#endif // MAINWINDOW_H
